﻿// -----------------------------------------------------------------------
//  <copyright file="SignalRLoggerProvider.cs" company="Hcf开源团队">
//      Copyright (c) 2017-2020 Hcf. All rights reserved.
//  </copyright>
//  <site>http://www.hcfrm.com</site>
//  <last-editor>Lemon</last-editor>
//  <last-date>2020/10/7 21:10:08</last-date>
// -----------------------------------------------------------------------

using Hcf.Logger.SignalR.Hubs;
using Microsoft.AspNetCore.SignalR;

namespace Hcf.Logger.SignalR.Logger
{
    public class SignalRLoggerProvider: ILoggerProvider
    {
        private readonly SignalRConfiguration _config;
        private readonly IHubContext<DataHub> _hubContext;

        public SignalRLoggerProvider(SignalRConfiguration signalRConfiguration, IHubContext<DataHub>hubContext)
        {
            _config = signalRConfiguration;
            _hubContext = hubContext;
        }

        public ILogger CreateLogger(string categoryName)
        {
            return new SignalRLogger(_config, _hubContext, categoryName);
        }

        public void Dispose(){}
    }
}
